<?php //debug($cars);?>
<div class="cars index">
	<h2><?php echo __('Vehículos'); ?></h2>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th><?php echo $this->Paginator->sort('client_id','Cliente'); ?></th>
			<th><?php echo $this->Paginator->sort('marca'); ?></th>
			<th><?php echo $this->Paginator->sort('modelo'); ?></th>
			<th><?php echo $this->Paginator->sort('chapa'); ?></th>
			<th class="actions"><?php echo __('Acciones'); ?></th>
	</tr>
	<?php
	foreach ($cars as $car): ?>
	<tr>
		<td><?php echo $this->Html->link($car['Client']['nombre'], array('controller' => 'clients', 'action' => 'view', $car['Client']['id']));?>&nbsp;</td>
		<td><?php echo h($car['Car']['marca']); ?>&nbsp;</td>
		<td><?php echo h($car['Car']['modelo']); ?>&nbsp;</td>
		<td><?php echo h($car['Car']['chapa']); ?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('Detalles'), array('action' => 'view', $car['Car']['id'])); ?>
			<?php echo $this->Html->link(__('Editar'), array('action' => 'edit', $car['Car']['id'])); ?>
			<?php echo $this->Form->postLink(__('Borrar'), array('action' => 'delete', $car['Car']['id']), null, __('Vehículo: (%s %s)\\nEsta seguro que desea eliminar este vehículo?\\nTodos los servicios asociados serán eliminados.', $car['Car']['marca'],$car['Car']['modelo'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Página {:page} de {:pages}, mostrando {:current} vehículos de un total de {:count}, desde {:start}, hasta {:end}')
	));
	?>	</p>

	<div class="paging">
	<?php
		echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	</div>
</div>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Lista Clientes'), array('controller' => 'clients', 'action' => 'index')); ?> </li>
		<li><?php  echo $this->Html->link('Volver',"javascript:history.back()"); ?> </li>
	</ul>
</div>
